package com.stwyj.sbd.config;

import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * <p>
 * mybatis plus 配置
 * </p>
 *
 * @author stwyj
 * @since 2018/6/21
 */
@EnableTransactionManagement
@Configuration
@MapperScan(basePackages = {"com.stwyj.sbd.dao.mapper"})
public class MybatisPlusConfig {

    /**
     * mybatis plus 分页插件（自动分页以及计算）
     * @return
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }
}
